﻿using Framework.Bus;
using Framework.Config;
using Framework.Infrastructure;
using Framework.Sample.Command.AccountCommands;
using Framework.Sample.Domain.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleTest
{
    class Program
    {
        static void Main(string[] args)
        {
            Configuration.Instance.OnlySyncCommandBusBuild();
            Configuration.Instance.OnlySyncEventBusBuild();

            //Configuration.Instance.DefaultCommandBusBuild();
            //Configuration.Instance.DefaultEventBusBuild();

            var commandBus = IoCFactory.Resolve<ICommandBus>();

            var command = new RegisterAccount
            {
                AccountName = "Ivan",
                Age = 30,
                Password = "1234"
            };
            commandBus.Send(command);


            var changePasswordCmd = new ChangePassword
            {
                Password = DateTime.Now.ToString(),
                AccountID = 1
            };
            commandBus.Send(changePasswordCmd);
        }
    }
}
